<template>
    <el-timeline :reverse="reverse">
        <el-timeline-item
          v-for="(activity, index) in activities"
          :key="index"
          :color="activity.color"
          :timestamp="activity.timestamp">
          
          <span v-html="activity.content"></span>
        </el-timeline-item>
    </el-timeline>
    </div>
</template>

<script>
import { getTaskNode} from "@/api/product/cashAuditDone";

export default {
    name:"timesProcess",
    props:{
        instanceId:{
            type: String,
            required: true
        },
    },
    data(){
        return {
            activities: [],
            reverse: false,
            queryParams2: {
                instanceId:undefined,
                auditOptionsKey: 'deptManagerResult,officeResult'
            }
        }
    },
    created() {
        this.handleViewHist(this.instanceId);
    },
    watch: {
        instanceId:function (val) {
            if(val){
                this.handleViewHist(val);
            }
            
        }
    },
    methods: {
        /** 查看审核记录 */
        handleViewHist(val) {
            this.queryParams2.instanceId = val ;
            getTaskNode(this.queryParams2).then(res => {
                this.activities = res.data;
            });
        }
    }
}
</script>